package com.tree.lambda;

import lombok.Data;
import lombok.ToString;

import java.util.Date;
import java.util.Objects;

/**
 * @ClassName com.tree.lambda
 * Description: <类功能描述>. <br>
 * <p>
 * <使用说明>
 * </p>
 * @Author tree
 * @Date 2019-08-24 22:23
 * @Version 1.0
 */
@Data
@ToString
public class User {
    private Integer id;

    private String userName;
    @ToString.Exclude
    private String password;

    private Integer age;
    @ToString.Exclude
    private Date createTime;


    public User(int id, String userName, Integer age) {
        this.userName = userName;
        this.id = id;
        this.age = age;
    }


    @Override
    public boolean equals(Object o) {
        User user = (User) o;
        return userName.equals(user.userName) &&
                age.equals(user.age);
    }

    @Override
    public int hashCode() {
        return Objects.hash(userName, age);
    }
}